/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("tb_project_reviewspecial",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using MYData.Entity.DomainModels;
using MYData.System.IServices;

using Microsoft.AspNetCore.Authorization;
using System.Net;
using MYData.Core.BaseProvider;
using MYData.Core.Utilities;
using MYData.Entity.DomainModels.ApiEntity.Dto;

namespace MYData.System.Controllers
{
    public partial class tb_project_reviewspecialController
    {
        private readonly Itb_project_reviewspecialService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public tb_project_reviewspecialController(
            Itb_project_reviewspecialService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }


        /// <summary>
        /// 专家列表显示+查询+分页
        /// 专家名称模糊查询,专家组下拉查询
        /// </summary>
        /// <returns></returns>
        [HttpGet, Route("GetlistReviewspecialAsync")]
        //[Authorize]
        [AllowAnonymous]
        public object GetlistReviewspecialAsync(string? specialistName = "", string? panelID = "")
        {
            return (_service.GetlistReviewspecialAsync(specialistName, panelID));
        }

        /// <summary>
        /// 专家列表添加
        /// </summary>
        /// <param name="inputdto"></param>
        /// <returns></returns>
        [HttpPost, Route("InsertReviewspecial")]
        [Authorize]
        [AllowAnonymous]
        public IActionResult InsertReviewspecialAsync([FromBody] tb_project_reviewspecialinput_Dto inputdto)
        {
            return Json(Service.InsertReviewspecialAsync(inputdto));
        }

        /// <summary>
        /// 专家列表修改
        /// </summary>
        /// <param name="inputdto"></param>
        /// <returns></returns>
        [HttpPost, Route("updateReviewspecial")]
        [Authorize]
        [AllowAnonymous]
        public IActionResult updateReviewspecialAsync([FromBody] tb_project_reviewspecialioutput_Dto outputdto)
        {
            return Json(Service.updateReviewspecialAsync(outputdto));
        }

        /// <summary>
        /// 专家列表删除
        /// </summary>
        /// <param name="inputdto"></param>
        /// <returns></returns>
        [HttpPost, Route("deleteReviewspecial")]
        [Authorize]
        [AllowAnonymous]
        public IActionResult deleteReviewspecialAsync(string id)
        {
            return Json(Service.deleteReviewspecialAsync(id));
        }

        /// <summary>
        /// 根据specialistName查询名字
        /// </summary>
        /// <param name="inputdto"></param>
        /// <returns></returns>
        [HttpGet,Route("BaseReviewspecialspecialistName")]
        [Authorize]
        [AllowAnonymous]
        public async Task<IActionResult> BaseReviewspecialspecialistName(string specialistName)
        {
            return Json( await Service.BaseReviewspecialspecialistName(specialistName));
        }

        /// <summary>
        /// 根据id查询数据
        /// </summary>
        /// <param name="specialistID"></param>
        /// <returns></returns>
        [HttpGet, Route("reviewspecialID")]
        [Authorize]
        [AllowAnonymous]
        public IActionResult reviewspecialID(string specialistID)
        {
            return Json( Service.reviewspecialID(specialistID));
        }

       
    }
}
